<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Victor
 * Date: 06.12.11
 * Time: 0:05
 * To change this template use File | Settings | File Templates.
 */

class indexController extends Core_BaseController
{

    function indexAction($p1 = null, $p2 = null)
    {
        $auth = $this->checkAuth();
        $cat = new Category_Manager();

        //var_dump($auth);
        $role = $this->getAuth()->getUserRoles($auth);
        //echo "User role has $role<br/>" ;

        $this->twig = $this->getRegistry()->twig;

        $categories = $cat->getAllCategories();


        $data = array('categories' => $categories);
        $data = array_merge($data, $auth);
        $data = array_merge($data,array('role' => $role));

        $template = $this->twig->loadTemplate('base.html.twig');
        echo  $template->render($data);


    }


}
